﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SharpDom;
using SharpDom.Mvc;


namespace Bzure.Apps.Security.Views
{
    public class Notification : SharpDomView<ViewModels.NotificationViewModel>
    {
        string GetClass(ViewModels.NotificationType type)
        {
            switch (type)
            {
                case ViewModels.NotificationType.Attention:
                    return "notification attention  close";
                case ViewModels.NotificationType.Error:
                    return "notification err  close";
                case ViewModels.NotificationType.Information:
                    return "notification information  close";
                case ViewModels.NotificationType.Success:
                    return "notification success  close";
                default:
                    return "notification attention  close";
            }
        }
        public override ContainerTag CreateTagTree(ContainerTag container)
        {
            return container
            [
                "<!--" + Model.Data + "-->",
                div.attr(@class: GetClass(Model.NotificationType))[
                  p[Model.Content]
                ]
            ];
        }
    }
}
